package action.main;

import java.util.Map;
import entity.Book;
import entity.Product;
import service.MainService;
import util.ObjectFactory;

public class BookDetailAction {
	private int pid;
	private Book product;
	private Map<Integer,String> cates;
	//injection
	private MainService mainService;
	public void setMainService(MainService mainService) {
		this.mainService = mainService;
	}
	public String execute() throws Exception{
		product = mainService.findBookById(pid);
		cates=mainService.findCategoryName(pid);
		return "success";
	}
	public int getPid() {
		return pid;
	}
	public void setPid(int pid) {
		this.pid = pid;
	}
	public Product getProduct() {
		return product;
	}
	public void setProduct(Book product) {
		this.product = product;
	}
	public Map<Integer,String> getCates() {
		return cates;
	}
	public void setCates(Map<Integer,String> cates) {
		this.cates = cates;
	}
	
	
}
